
//this program doesn't work and I think it is because the extends token must not be well programmed in the compiler the problem is in the init() i cant use the methods i tried putting this.setName and this.setWeight but it doesn work either..

object Inheritance {
	
        def main() : Unit = {
          println(new Dog().init());
	}
}



class Animals {
	var weight : String;
	def setWeight(w : String):Bool ={
      	  	weight = w;
		return true;
	}
	def getWeight():String={
       		 return weight;
	}
}
class Dog extends Animals {
	var name : String;
	def setName(s : String):Bool={
		name = s;
		return true;
	}
	def getName():String={
		return name;
	}
	def init(): String = {
		var s : String;
		var dummy: Bool;
		dummy = this.setWeight("40");
		dummy = this.setName("medor");
		s = this.getWeight()+this.getName();
		return s;
	}
} 
